home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / TUTORIAL.STX < prev    next >
Encoding:
Text File  |  2000-06-30  |  25.2 KB  |  826 lines

  1. Welcome to the Zope Tutorial
  2.  
  3.   This tutorial show you the basics of using Zope. You will
  4.   learn how to create and manage Zope resources by building
  5.   a web site devoted to tracking Elvis sightings. Each lesson
  6.   includes working examples in Zope that allow you to learn
  7.   by hands-on experimentation.
  8.   
  9.   The tutorial assumes that you are familiar with basic Internet
  10.   technologies such as <a href="http://www.w3.org/MarkUp/Guide/"
  11.   target="_blank">HTML</a>,
  12.   URLs, and web browsers.
  13.   
  14.   The "Back" and "Next" buttons on the bottom of each tutorial
  15.   page allow you to navigate the tutorial.
  16.   
  17.   If you get lost you can use your browser's back button to
  18.   return to an earlier lesson.
  19.   
  20.   If you want to quit the tutorial close your browser window.
  21.   You can return to the tutorial later by visiting the tutorial
  22.   object you created in the Zope management screen, and viewing
  23.   its "README" document.
  24.   
  25.   <dtml-unless tutorialExamplesURL>
  26.   <dtml-call "REQUEST.set('hide_'+'next', 1)">
  27.   
  28.   Install Tutorial Examples  
  29.   
  30.     Before you can begin the tutorial you must install the tutorial
  31.     examples.
  32.   
  33.       1. Go to the Zope management screen and choose 'Zope Tutorial' from
  34.       the product add list.
  35.   
  36.       2. Choose an id for the tutorial and click the 'Add' button.
  37.   
  38.       3. Now you should be taken to the tutorial.
  39.       
  40.   </dtml-unless>
  41.   
  42. Lesson 1. "Elvis Lives" Home Page
  43.  
  44.   <dtml-var "tutorialShowLesson(1, REQUEST)">
  45.  
  46.   Let's create a home page for "Elvis Lives", an organization that
  47.   tracks Elvis sightings.
  48.   
  49.   First you need to create a [DTML Document]
  50.   for the home page. Zope uses 'DTML Documents' for web pages.
  51.   
  52.     1. Select 'DTML Document' from the product add list.
  53.  
  54.     2. Type 'home.html' for the document [id].
  55.     
  56.     3. Type 'Elvis Lives' for the document [title].
  57.   
  58.     4. Click 'Add and Edit'.
  59.   
  60.   You should now see a screen
  61.   where you can edit your web page.
  62.   
  63.     1. Change the contents of the document to::
  64.       
  65.       <dtml-var standard_html_header>
  66.  
  67.       <dtml-var header.gif>
  68.  
  69.       <p>
  70.       Welcome to <i><dtml-var title></i>,
  71.       your source for information about
  72.       Elvis and Elvis sightings.
  73.       </p>
  74.  
  75.       <dtml-var standard_html_footer>
  76.       
  77.     2. Click the 'Change' button.
  78.     
  79.   The contents of the document are a mixture of HTML and special
  80.   tags called [DTML].
  81.   
  82.   The [<dtml-var>] tag inserts things into
  83.   web pages. In this page we insert a page header, a page footer,
  84.   an image, and a title with DTML.
  85.   
  86.   Now let's see what our page
  87.   looks like.
  88.   
  89.     1. Click the 'View' tab at the top of the screen.
  90.   
  91.   Congratulations you've created
  92.   a web page with Zope.
  93.  
  94.   Summary
  95.   
  96.     Zope allows you to create and manage objects through
  97.     the web.
  98.  
  99.     * Zope uses [DTML Document]s
  100.     for web pages.
  101.  
  102.     * Create Zope objects by choosing them from the product add list.
  103.  
  104.     * View Zope objects by clicking the 'View' tab.
  105.  
  106.     * Insert content in web pages with the
  107.     [<dtml-var>] tag.
  108.  
  109.   In the next lesson you'll expand
  110.   your web site.
  111.  
  112. Lesson 2. Going to Graceland
  113.  
  114.   <dtml-var "tutorialShowLesson(2, REQUEST)">
  115.  
  116.   Elvis loved his home, Graceland.  Let's link an existing 
  117.   page to our web site with information about Graceland.
  118.   
  119.     1. Click on the 'graceland' [Folder].
  120.     
  121.     2. Inside you should see a number of objects including an
  122.     'index_html' document.
  123.     
  124.   If a [Folder] contains an object named [index_html], that object
  125.   provides the folder's default view. This is just like how an
  126.   'index.html' or a 'default.htm' file works with a conventional
  127.   web server.
  128.  
  129.   Notice that the location of the 'graceland' folder appears at the
  130.   top of the management screen. This tells you the URL of the
  131.   folder. 
  132.   
  133.   You can navigate between Zope management screens using the location
  134.   links. Go back up to the enclosing folders by clicking their ids in
  135.   the URL.
  136.     
  137.     3. Return to the enclosing folder by clicking the 'lesson2' link
  138.     in the folder's URL.
  139.     
  140.     4. Click on the 'home.html' document to edit it.
  141.     
  142.     5. Change the contents of the 'home.html' document to::
  143.     
  144.       <dtml-var standard_html_header>
  145.  
  146.       <dtml-var header.gif>
  147.  
  148.       <p>
  149.       Welcome to <i><dtml-var title></i>,
  150.       your source for information about
  151.       Elvis and Elvis sightings.
  152.       </p>
  153.       
  154.       <h2>About Elvis</h2>
  155.       
  156.       <p>
  157.       Elvis was born in
  158.       <a href="graceland">Graceland</a>.
  159.       </p>
  160.  
  161.       <dtml-var standard_html_footer>
  162.       
  163.     6. Click the 'Change' button.
  164.   
  165.   This adds a link the the 'graceland' folder. Now let's test
  166.   out the link.
  167.   
  168.     7. Click the 'View' tab.
  169.   
  170.   You've successfully created a multi-page site with a link between two
  171.   Zope objects.
  172.  
  173.   Summary
  174.     
  175.     Zope files and documents have a lot in common with
  176.     conventional web pages--they have names, are arranged in hierarchies,
  177.     and have URLs that correspond to their locations.
  178.     
  179.     * [Folder]s contain other Zope objects.
  180.  
  181.     * The default object for a Folder is named [index_html].
  182.  
  183.     * The Zope management screens allow you to navigate between folders
  184.       and determine the URLs of objects.
  185.  
  186.   In the next lesson you'll learn about moving
  187.   pages around in Zope.
  188.  
  189. Lesson 3. Elvis's Favorite Foods
  190.  
  191.   <dtml-var "tutorialShowLesson(3, REQUEST)">
  192.  
  193.   Elvis really liked to eat. Right now we have a couple pages about
  194.   foods Elvis liked. But as our web site grows we'll need a whole area
  195.   devoted to food. Let's create a [Folder] for food information.
  196.   
  197.     1. Select 'Folder' from the product add list.
  198.     
  199.     2. Type 'food' for the folder id.
  200.     
  201.     3. Type 'Elvis and Food' for the folder title.
  202.     
  203.     4. Uncheck the 'Create public interface' and 'Create user folder'
  204.     check boxes.
  205.  
  206.     5. Click the 'Add' button.
  207.     
  208.   Now we've got some place to put our food related resources. Let's
  209.   move some objects into this folder.
  210.   
  211.     1. Select the 'sandwiches', 'pie', and 'meatloaf' documents by
  212.     clicking their check boxes.
  213.     
  214.     2. Click the 'Cut' button.
  215.  
  216.     3. Click the 'food' folder to enter it.
  217.     
  218.     4. Click the 'Paste' button.
  219.     
  220.   Now that we've moved some objects, we need to update the links to
  221.   them because an object's URL is related to its location.
  222.   
  223.     1. Return the the 'home.html' document in the 'lesson3' folder,
  224.     by clicking on the 'lesson3' location link and then clicking 
  225.     on the 'home.html' document.
  226.     
  227.     2. Change the links to the sandwiches, pie and cake documents
  228.     to::
  229.     
  230.       <p>
  231.       Elvis liked to eat
  232.       <a href="food/sandwiches">sandwiches</a>,
  233.       <a href="food/pie">pie</a>, and 
  234.       <a href="food/meatloaf">meatloaf</a>.
  235.       </p>
  236.       
  237.     3. Click the 'Change' button.
  238.     
  239.     4. Click the 'View' tab at the top of the screen.
  240.   
  241.   Notice that the food resources are now correctly linked from the home
  242.   page in their new location.
  243.   
  244.   Congratulations you've performed your first
  245.   web site overhaul! 
  246.  
  247.   Summary
  248.  
  249.     You can organize Zope object in folders. You can create
  250.     new folders and move objects between folders.
  251.  
  252.     * Move Zope objects around with [Cut] and [Paste].
  253.  
  254.     * Folders contain other Zope objects.
  255.  
  256.     * Moving a Zope object between folders changes its URL. 
  257.  
  258.   In the next lesson you'll learn how to change
  259.   the look and feel of your site.
  260.     
  261. Lesson 4. Site Contact Information
  262.  
  263.   <dtml-var "tutorialShowLesson(4, REQUEST)">
  264.   
  265.   Part of running an Elvis web site is getting in touch with Elvis
  266.   fans the world over. One way to do this is to provide contact
  267.   information on your site so that visitors can email you. Let's
  268.   create an email link at the bottom of each page on your site that
  269.   lets people send you feedback.
  270.   
  271.     1. Click the 'Properties' tab.
  272.     
  273.     2. Type 'webmaster' in the Name field.
  274.     
  275.     3. Type your email address in the Value field.
  276.     
  277.     4. Click the 'Add' button.
  278.     
  279.     Now you've created a property that defines your email address. Now
  280.     let's put a link to this address in the web page footer.
  281.   
  282.     1. Click the 'Contents' tab to return to the list of items in the
  283.        folder, then click the 'standard_html_footer' [DTML Method] to edit it.
  284.     
  285.     2. Change the contents of the method to::
  286.     
  287.       <hr>
  288.       <a href="mailto:<dtml-var webmaster>?subject=<dtml-var
  289.       title>">Email Webmaster</a>
  290.       </body>
  291.       </html>
  292.    
  293.     3. Click the 'Change' button.
  294.  
  295.   We've change the standard Zope footer. Now let's verify that this
  296.   change is reflected in our web pages.
  297.     
  298.     4. Navigate to the 'home.html' document in the 'lesson4' folder
  299.     by clicking on the 'lesson4' location link and then clicking 
  300.     on the 'home.html' document.
  301.     
  302.     5. Now click the 'View' tab to view the web site.
  303.     
  304.   Notice that there is now an email link at the bottom of every web
  305.   page. The email link uses the property you defined and includes the
  306.   title of the web page as the email subject.
  307.   
  308.   The email link appears on every page because every page
  309.   includes the 'standard_html_footer' object with the
  310.   [<dtml-var>] tag.
  311.     
  312.   Summary
  313.   
  314.     By consolidating content into components such as a common footer
  315.     you can provide a uniform look and feel for your web site.
  316.   
  317.     * [Properties] contain small pieces of content.
  318.     
  319.     * Use the [<dtml-var>] tag to insert properties into web
  320.     pages.
  321.     
  322.     * [standard_html_footer] is used as the default Zope web page footer.
  323.  
  324.   In the next lesson you'll see how to organize content
  325.   with a collection of Zope objects.
  326.  
  327. Lesson 5. Recent Elvis Sightings
  328.  
  329.   <dtml-var "tutorialShowLesson(5, REQUEST)">
  330.   Elvis sightings happen all the time. You'd like to record them and
  331.   list them on your web site. Let's look at a simple system for
  332.   organizing sightings and displaying them on your web site.
  333.   
  334.     1. Click the 'sightings' web page.
  335.   
  336.     2. Click the 'View' tab to view it.
  337.     
  338.   Notice how the page lists a number of Elvis sightings. Also notice
  339.   that these sightings weren't specifically listed in the contents of
  340.   the web page. Where did they come from?
  341.   
  342.     1. Click the 'sightingsFolder' folder to enter it.
  343.     
  344.     2. Click on the 'Shelbyville' method to examine it.
  345.   
  346.     3. Go back the 'sightingsFolder' folder by clicking the
  347.     'sightingsFolder' location link.
  348.     
  349.     4. Select the 'Shelbyville' method by clicking its check box.
  350.   
  351.     5. Click the 'Delete' button.
  352.     
  353.   You just deleted a Zope object that describes an Elvis sighting.
  354.   Let's see how this affects the 'sightings' web page.
  355.   
  356.     1. Click the 'sightings' web page.
  357.     
  358.     2. Click the 'View' tab to view it.
  359.     
  360.   The Shelbyville sighting is not longer listed. So the list of
  361.   sightings is somehow built from the methods in the 'sightingsFolder'
  362.   folder.
  363.   
  364.   What if you want the Shelbyville sighting back? Since you deleted
  365.   it, you can't just paste it back. You need to [Undo] your action.
  366.   
  367.     1. Click the 'Undo' tab.
  368.     
  369.     2. Select the first transaction (ending with "manage_delObjects")
  370.     by clicking its check box.
  371.     
  372.     3. Click the 'Undo' button.
  373.     
  374.     4. Click the 'sightingsFolder' folder to enter it.
  375.     
  376.   Sure enough the 'Shelbyville' sighting has returned.  
  377.   
  378.   Summary
  379.   
  380.     Multiple Zope objects can be combined to form complex web pages.
  381.   
  382.     * [DTML Method]s contain chunks of content.
  383.   
  384.     * Web pages can insert content from 'DTML Methods'.
  385.   
  386.     * You can recover from mistakes with [Undo].
  387.  
  388.   In the next lesson you'll learn about
  389.   looping over lists of Zope objects.
  390.   
  391. Lesson 6. Recent Elvis Sightings, cont.  
  392.   
  393.   <dtml-var "tutorialShowLesson(6, REQUEST)">
  394.   So we've seen that the 'sightings' page is built from objects in the
  395.   'sightingsFolder' folder. How does it work?
  396.   
  397.     1. Click the 'sightings' document to edit it.
  398.   
  399.     2. Change the contents of the document to::
  400.     
  401.       <dtml-var standard_html_header>
  402.       <h2><dtml-var title></h2>
  403.       
  404.       <table border="1">
  405.       <dtml-in expr="sightingsFolder.objectValues()">
  406.       <tr><td>
  407.         <dtml-var sequence-item>
  408.       </td></tr>
  409.       </dtml-in>
  410.       </table>
  411.       
  412.       <dtml-var standard_html_footer>
  413.       
  414.     3. Click the 'Change' button.
  415.     
  416.     4. Click the 'View' tab.
  417.     
  418.   Notice how each sighting now has a box drawn around it.
  419.   
  420.   What's going on? The [<dtml-in>] tag iterates over a list of
  421.   objects. The '<dtml-var sequence-item>' tag inserts the
  422.   current object. The 'expr="sightingsFolder.objectValues()"' part of
  423.   the '<dtml-in>' tags tells it how to get a list of objects. It
  424.   calls the 'objectValues' method of the 'sightingsFolder' folder.
  425.   'objectValues' returns all the objects contained by a folder.
  426.   
  427.   Summary
  428.   
  429.     You can programmatically build web pages with groups of objects
  430.     by looping over them and inserting them.
  431.   
  432.     * [<dtml-in>] iterates over a list of objects.
  433.     
  434.     * '<dtml-var sequence-item>' inserts the current object
  435.     when looping over a list of objects.
  436.     
  437.     * You can get the contents of a folder by calling its
  438.     'objectValues' method.
  439.  
  440.   In the next lesson you'll learn about how to
  441.   manage and display pictures.
  442.     
  443. Lesson 7. Elvis Photo Archive
  444.  
  445.   <dtml-var "tutorialShowLesson(7, REQUEST)">
  446.   The King had many faces. We can offer our site visitors a peek at
  447.   the many sides of Elvis with a photo archive.
  448.   
  449.     1. Click the 'photos' document.
  450.   
  451.     2. Click the 'View' tab to view it.
  452.   
  453.   This page shows the photos in the archive one after another. It's not
  454.   very fancy.
  455.   
  456.   Let's improve it to organize the photos by title and size.
  457.   The improved photo archive will list
  458.   the photos by title and includes a link each
  459.   picture.
  460.   
  461.     1. Click the 'photos' document to edit it.
  462.     
  463.     2. Change the document contents to::
  464.     
  465.       <dtml-var standard_html_header>
  466.       
  467.       <h2><dtml-var title></h2>
  468.  
  469.       <dtml-in expr="photoArchive.objectValues()">
  470.       <p>
  471.         <a href="<dtml-var absolute_url>"><dtml-var title></a>
  472.         (<dtml-var getSize> bytes)
  473.       </p>
  474.       </dtml-in>
  475.       
  476.       <dtml-var standard_html_footer>
  477.      
  478.     3. Click the 'Change' button.
  479.     
  480.     4. Click the 'View' tab.
  481.     
  482.   Notice how the photo list now shows a link to each photo along with
  483.   its size.
  484.   
  485.   Summary
  486.   
  487.     [Image]s can display themselves and can also provide useful
  488.     information such as size, title, and URL.
  489.   
  490.     * Get the contents of a Folder with the 'objectValues' method.
  491.   
  492.     * Get the size of an [Image] with the 'getSize' method.
  493.     
  494.     * Get the URL of an object with the 'absolute_url' method.
  495.   
  496.   In the next lesson you'll learn how to create
  497.   pictures with DTML scripting.
  498.   
  499. Lesson 8. Elvis Photo Archive, cont. 
  500.  
  501.   <dtml-var "tutorialShowLesson(8, REQUEST)">
  502.   Now that we have a working photo archive, let's enhance it to handle
  503.   submissions from site visitors.
  504.   
  505.     1. Click the 'photoForm' document.
  506.     
  507.     2. Click the 'View' tab to view it.
  508.     
  509.     3. Upload a picture (JPG, GIF, PNG or other graphics format supported
  510.     by your browser.)
  511.     
  512.     4. Now return to the 'lesson8' folder in the Zope management screen
  513.     using your browser's back button.
  514.     
  515.     5. Click the 'photoArchive' folder to enter it.
  516.   
  517.   Notice that there is now a new [Image] object in the folder. This
  518.   image was created when you uploaded your photo.
  519.   
  520.   Let's investigate how this works, and add the ability to give our
  521.   uploaded photo a title.
  522.   
  523.     1. Click the 'photoForm' document.
  524.     
  525.     2. Change the contents of the document to::
  526.     
  527.       <dtml-var standard_html_header>
  528.       
  529.       <h2><dtml-var title></h2>
  530.       
  531.       <p>Upload a picture to the Elvis Photo Archive.</p>
  532.       
  533.       <form action="photoAction" method="post"
  534.       enctype="multipart/form-data">
  535.       <p>Title: <input type="text" name="photo_title"></p>
  536.       <p>File: <input type="file" name="file"></p>
  537.       <input type="submit">
  538.       </form>
  539.       
  540.       <dtml-var standard_html_footer>
  541.   
  542.     3. Click the 'Change' button.
  543.     
  544.   This document collects data needed to create an Image. It calls the
  545.   'photoAction' document with that data. The 'photoAction' document
  546.   actually creates the Image.
  547.     
  548.     4. Click the 'photoAction' document to edit it. 
  549.    
  550.     5. Change the contents of the document to::
  551.     
  552.       <dtml-var standard_html_header>
  553.       
  554.       <h2><dtml-var title></h2>
  555.       
  556.       <dtml-call
  557.         expr="photoArchive.manage_addImage(
  558.           id='', file=file, title=photo_title)">
  559.       
  560.       <p>Thanks for your photo submission.</p>
  561.       
  562.       <dtml-var standard_html_footer>
  563.       
  564.   The 'photoAction' document uses the [<dtml-call>] tag to
  565.   perform an action without inserting anything into the web page. It
  566.   calls the 'manage_addImage' method on the 'photoArchive' folder.
  567.   'manage_addImage' is a folder method that creates a new
  568.   Image.
  569.   
  570.   Summary
  571.   
  572.     You can use forms to pass information between Zope objects.
  573.     You can programmatically create new Zope objects.
  574.   
  575.     * Zope documents can be the action of HTML forms.
  576.   
  577.     * The [<dtml-call>] tag performs an action without inserting
  578.     anything into a web page.
  579.   
  580.     * Create new [Image]s in folder with the 'manage_addImage' method. 
  581.  
  582.   In the next lesson you'll learn about [HTTP Cookies] and
  583.   personalizing your web site.
  584.  
  585. Lesson 9. Elvis, Up Close and Personal
  586.   
  587.   <dtml-var "tutorialShowLesson(9, REQUEST)">
  588.   People who come to your site want a personal relationship with
  589.   Elvis. You can provide this by tailoring your site to your viewer's
  590.   needs and preferences. Let's add the ability to bring new Elvis
  591.   sightings to the attention of site visitors. This way when a visitor
  592.   comes to your site they'll immediately know which sightings are new
  593.   since they last visited.
  594.   
  595.     1. Click the 'sightings' document to edit it.
  596.     
  597.     2. Click the 'View' tab to view it.
  598.     
  599.   All the sightings should be
  600.   marked as New.
  601.   
  602.     3. Reload the page.
  603.     
  604.   Now none of the sightings should be marked as New. This is because
  605.   you've already seen them.
  606.   
  607.     4. Click the 'sightingsFolder' folder to enter it.
  608.     
  609.     5. Choose 'DTML Method' from the product add list.
  610.     
  611.     6. Type 'Seattle' for the id. Since the title is optional and isn't
  612.     really needed in this case, leave the title field blank.
  613.     
  614.     7. Click the 'Add and Edit' button.
  615.     
  616.     8. Change the contents of the method to::
  617.     
  618.       <p>6/1/2000 -- Seattle</p>
  619.       <p>Elvis spotted spare changing on Broadway.
  620.       He denied being the King.</p>
  621.     
  622.     9. Click the 'Change' button.
  623.     
  624.   Now you've created a new sighting. Let's see if it is marked as new
  625.   by the sightings page.
  626.   
  627.     10. Click the 'sightings' document in the 'lesson9' folder.
  628.     
  629.     11. Click the 'View' tab.
  630.     
  631.   Sure enough our new sighting is marked New.
  632.   
  633.   How does this work? It uses [HTTP Cookies]. When you visit the
  634.   'sightings' page a cookie is set that records the current time. Then
  635.   each time you return to the page sightings that are newer than the
  636.   cookie will be marked as new.
  637.   
  638.   Let's look at the DTML for the 'sightings' page to see how this is
  639.   done.
  640.   
  641.     1. Click the 'sightings' document to edit it.
  642.     
  643.   The document sets a cookie with this code::
  644.   
  645.     <dtml-call expr="RESPONSE.setCookie('lastVisited', ZopeTime())">
  646.  
  647.   The document checks each sighting when displaying it to see if it is
  648.   newer than the 'lastVisited' cookie::
  649.   
  650.     <dtml-if expr="bobobase_modification_time() >
  651.       ZopeTime(lastVisited)">
  652.   
  653.   Summary
  654.   
  655.     You can use cookies to personalize a web page. Zope documents
  656.     can dynamically control their presentation.
  657.   
  658.     * You can set cookies with the 'RESPONSE.setCookie' method.
  659.     
  660.     * The [<dtml-if>] tag allows you to test conditions.
  661.     
  662.     * The 'bobobase_modification_time' method returns the last
  663.     modification time of an object.
  664.  
  665.   In the next lesson you'll learn how to create
  666.   a mail feedback form.
  667.  
  668. Lesson 10. So You've Seen Elvis
  669.  
  670.   <dtml-var "tutorialShowLesson(10, REQUEST)">
  671.   What's the first thing you do when you spot Elvis? Report it at the
  672.   "Elvis Lives" web site! Let's enhance our site to allow visitors to
  673.   report their Elvis sightings.
  674.   
  675.     1. Click 'mailhost' [Mail Host] object to edit it.
  676.     
  677.     2. Type the name of your mail server in the 'SMTP Host' field.
  678.     
  679.   Your mail server is typically named 'mail'. For example,
  680.   'mail.elvislives.com'. If you don't know the name of your mail
  681.   server, ask your system administrator, or check the configuration of
  682.   your mail client.
  683.   
  684.     3. Click the 'Change' button.
  685.     
  686.   Now Zope can send mail. Next let's edit the template for the Elvis
  687.   sighting report mail message.
  688.   
  689.     1. Click the 'reportAction' document to edit it.
  690.     
  691.   This document is called when a site visitor fills out an Elvis
  692.   sighting form. This document sends you mail telling you about the
  693.   sighting. Mail is sent with the [<dtml-sendmail>] tag which
  694.   works with the mail host you just configured.
  695.   
  696.   Notice that the 'to' and the 'from' line both reference a
  697.   property named 'send_to'.
  698.  
  699.     2. Click the 'Properties' tab to edit properties.
  700.     
  701.     3. Type your email address into the 'send_to' property field.
  702.     
  703.     4. Click the 'Save Changes' button.
  704.     
  705.     5. Now go to the 'reportForm' document in the 'lesson10' folder.
  706.     
  707.     6. Click the 'View' tab to view it.
  708.     
  709.     7. Fill out the Elvis sighting form and submit it.
  710.     
  711.   You should now receive a piece of email describing the Elvis
  712.   sighting.
  713.   
  714.   Congratulations, you've built a mail form. If you receive
  715.   a Zope error, there is a good chance that you haven't set the 'SMTP
  716.   Host' setting on your mail host object correctly. 
  717.  
  718.   Summary
  719.   
  720.     After you create a mail host, you can send mail from any
  721.     Zope document using the [<dtml-sendmail>] tag.
  722.   
  723.     * [Mail Host]s allow you to send email.
  724.     
  725.     * The [<dtml-sendmail>] tag sends an email message.
  726.  
  727.   In the next lesson you'll learn how to use Zope
  728.   to put a database on the web.
  729.  
  730. Lesson 11. The Elvis Files
  731.  
  732.   <dtml-var "tutorialShowLesson(11, REQUEST)">
  733.   Everyone knows that serious web sites use databases. We agree. Let's
  734.   convert our Elvis sightings system to use a relational database.
  735.   This will provide us with scalability and interoperability.
  736.   
  737.   Let's see how Zope gets data
  738.   from a database.
  739.   
  740.     1. Click the 'connection' [Database Connection] to edit it.
  741.     
  742.   A [Database Connection] tells Zope how to access a relational
  743.   database. 
  744.   
  745.     2. Click the 'Browse' tab to examine the database tables.
  746.     
  747.     3. Click the plus box next to the 'ELVIS_SIGHTINGS' table to
  748.     expand it.
  749.     
  750.   Now you can see the column names and types for this table. Now let's
  751.   see how to get information out of this table.
  752.  
  753.     1. Click the 'getSightings' [ZSQL Method] in the 'lesson11' folder
  754.     to edit it.
  755.  
  756.   Notice that the SQL statement used to fetch information about Elvis
  757.   sightings is editable in the 'Query template' field.
  758.   
  759.     2. Click the 'Test' tab.
  760.     
  761.     3. Click the 'Submit  Query' button.
  762.     
  763.   This shows you what data the ZSQL Method returns.
  764.   
  765.   A [ZSQL Method] is used to get information out of or into a relational
  766.   database.
  767.   
  768.   Now let's see how to use
  769.   this ZSQL Method in a web page.
  770.   
  771.     1. Click the 'sightings' DTML Document in the 'lesson11' folder
  772.     to edit it. 
  773.  
  774.   Notice that the sightings are generated by iterating over the
  775.   'sightings' ZSQL Method with the '<dtml-in>' tag.
  776.   
  777.     2. Add a line between each sighting by changing the contents of
  778.     the 'sightings' DTML Document to::
  779.     
  780.       <dtml-var standard_html_header>
  781.       <h2><dtml-var title></h2>
  782.  
  783.       <dtml-in getSightings>
  784.       <p><dtml-var date> -- <dtml-var location></p>
  785.       <p>Reported by <dtml-var name></p>
  786.       <p><dtml-var description></p>
  787.       <hr>
  788.       </dtml-in>
  789.       
  790.       <dtml-var standard_html_footer>
  791.       
  792.     3. Click the 'Change' button.
  793.     
  794.     4. Click the 'View' tab to view the document.
  795.     
  796.   Summary
  797.   
  798.     Zope can work with data from relational databases in the
  799.     same way it treats other Zope objects.
  800.   
  801.     * [Database Connection]s tell Zope about relational databases.
  802.  
  803.     * [ZSQL Method]s get information out of or into a relational
  804.     database.
  805.  
  806. Congratulations
  807.  
  808.   Well done! You've finished the Zope Tutorial.
  809.   
  810.   You can return to lesson examples and use these objects as the
  811.   basis of your own experiments. Just copy and paste them and start
  812.   changing them.
  813.   
  814.   To find out more about Zope visit
  815.   <a href="http://www.zope.org">Zope.org</a>.
  816.   
  817.   You may be especially interested in the Zope
  818.   <a href="http://www.zope.org/Documentation/How-To">How-Tos</a>, 
  819.   <a href="http://www.zope.org/Resources/MailingLists">mailing lists</a>,
  820.   Guides and the <a href="http://zdp.zope.org">Zope Documentation Project</a>.
  821.   
  822.   Please <a href="mailto:docs@digicool.com">let us know</a> what you liked and disliked
  823.   about the Zope Tutorial. Telling us what you think helps us
  824.   improve it.
  825.   
  826.